public class ClientClass {
    public static void main(String[] args) {
        Factory factory = new Factory();

        // 原始对象
        Fruit realApple = factory.CreateFruit("A");

        // 动态代理使用
        Fruit dynamicProxy = (Fruit) new FruitDynamicProxy(realApple).getProxyInstance();
        dynamicProxy.eat();
    }
}